Balance = cc.Sprite.extend({
	ctor:function(parent){
		this._super("#balance.png");
		parent.addChild(this, 1, TAG_BALANCE);
		this.init();
	},
	init:function(){
		this.setPosition(1000, 250);// 150,300
		// 右码
		var paper = new cc.Sprite("#paper.png");
		paper.setCascadeOpacityEnabled(true);
		paper.setPosition(195,126);
		this.addChild(paper,1,TAG_PAPER3);
		
		
		var fama = new Button(this, 1, TAG_FAMA, "#fama.png", this.callback);
		fama.setCascadeOpacityEnabled(true);
		fama.setPosition(195,126);

		var _5g = new cc.LabelTTF("5g",gg.fontName,gg.fontSize);
		_5g.setPosition(fama.width * 0.5,fama.height + 15);
		_5g.setColor(cc.color(0,0,0));
		fama.addChild(_5g);
	},
	showDisk:/**
				 * 出现指针
				 */
	function(type){
		if(type == null){
			type = 1;
		}
		var disk = new DiskPoint();
		disk.setPosition(this.width * 0.5, this.height + disk.height * 0.4);
		this.addChild(disk);
		if(type == 1){
			disk.show();	
		} else if(type == 2){
			disk.showRight();
		}
	},
	showRider:function(){
		var rider = new cc.Sprite("#rider1.png");
		rider.setPosition(this.width * 0.5, 0);
		this.addChild(rider);
		rider.setCascadeOpacityEnabled(true);
		var rider2 = new cc.Sprite("#rider2.png");
		rider2.setAnchorPoint(0, 0.5);
		rider2.setPosition(0,rider.height * 0.5);
		rider.addChild(rider2);
		
		var seq = cc.sequence(cc.moveBy(1.5, 100, 0), cc.callFunc(function(){
			this.showDisk();
		},this),cc.delayTime(0.5), cc.callFunc(function(){
			rider.runAction(cc.fadeOut(0.5));
		}, this));
		rider2.runAction(seq);
	},
	outFama:function(){
		this.getChildByTag(TAG_FAMA).setOpacity(0);
	},
	outPaper:function(){
		this.getChildByTag(TAG_PAPER3).setOpacity(0);
	},
	inFama:function(){
		this.getChildByTag(TAG_FAMA).setOpacity(255);
	},
	inPaper:function(){
		this.getChildByTag(TAG_PAPER3).setOpacity(255);
	},	
	callback:function(p){
		switch (p.getTag()) {
		case TAG_FAMA:
			var seq = cc.sequence(
				cc.moveTo(0.3, cc.p(200, 210)),
				cc.fadeOut(0.3),cc.callFunc(function(){
					gg.flow.next();
				}));
			p.runAction(seq);
			break;
		}
	}
});